﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" x:Class="CustomControls.MapLocation.LocationRadio"
	x:Name="UserControl" Background="{Binding ElementName=radioButton,Path=Background}" Margin="0,15,0,0">

    <UserControl.Resources>
        <SolidColorBrush x:Key="CheckBoxStroke" Color="#8E8F8F"/>
        <Style x:Key="CheckRadioFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="14,0,0,0" SnapsToDevicePixels="true"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="LocationRadioButtonStyle" TargetType="{x:Type RadioButton}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="Background" Value="White"/>
            <Setter Property="BorderBrush" Value="{StaticResource CheckBoxStroke}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                    	<Border x:Name="border" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" BorderThickness="0" Background="{TemplateBinding Background}">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Color="#FFE8E1E1" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <StackPanel Orientation="Horizontal" Margin="0,0,10,5" HorizontalAlignment="Left">
                            	<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,8,0,0">
                            		<Rectangle Fill="#FFF09E11" Margin="17,0,0,10" Stroke="#FFF09E11" StrokeThickness="1" Width="1" HorizontalAlignment="Left" d:LayoutOverrides="Width"/>
                            		<Rectangle Fill="#FFF09E11" Margin="17,0,17,11" Stroke="#FFF09E11" StrokeThickness="1"/>
                            		<Path x:Name="path" Fill="#FFF09E11" Stretch="Fill" Stroke="#FFF09E11" StrokeThickness="0" Width="35.682" Height="Auto" Data="M17.725584,58.999999 C17.307234,50.52749 15.058155,41.521884 11.14157,36.255874 5.2027148,28.013423 1.4423701,24.837525 0.22365119,19.235751 -0.93310927,14.9922 1.5480881,-0.12558873 17.526054,0.00078762896 z M17.734792,59.006376 C18.156818,50.518719 20.462382,41.596119 24.413372,36.320694 30.404398,28.063507 34.197776,24.881931 35.427201,19.270142 36.594123,15.019004 33.679381,-0.12581376 17.561054,0.00078854063 z" HorizontalAlignment="Right" UseLayoutRounding="False" OpacityMask="#FFF09E11" Margin="0,0,0,-0.006"/>
                            		<TextBlock x:Name="indexTextBox1" VerticalAlignment="Center" Height="Auto" Text="{Binding Index}" TextWrapping="Wrap" HorizontalAlignment="Center" Margin="0,0,0,27" TextAlignment="Center"/>
                            	</Grid>
                            	<StackPanel Orientation="Vertical" d:LayoutOverrides="Width" VerticalAlignment="Center">
                            		<TextBlock x:Name="formattedAddressTextBox"  FontSize="15" FontWeight="Normal" HorizontalAlignment="Stretch" Margin="5" Text="{Binding FormattedAddress}" Foreground="#FF140886" TextDecorations="Underline" TextWrapping="Wrap" Width="270" />
                            	</StackPanel>
                        	</StackPanel>
                        </Border>
                        <ControlTemplate.Triggers>
                    		<Trigger Property="IsChecked" Value="true">
							<Setter Property="Background" Value="#FFE4E4E4" />
							</Trigger>
                            <Trigger Property="HasContent" Value="true">
                    			<Setter Property="FocusVisualStyle" Value="{StaticResource CheckRadioFocusVisual}"/>
                    			<Setter Property="Padding" Value="4,0,0,0"/>
                    		</Trigger>
                    		<Trigger Property="IsEnabled" Value="false">
                    			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    		</Trigger>
                    	</ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <RadioButton x:Name="radioButton" GroupName="LocationResults" Style="{DynamicResource LocationRadioButtonStyle}" HorizontalAlignment="Left" />
</UserControl>